window.onload = function() {

	oForm = document.getElementsByTagName('form')[0];
	oText = oForm.username;

	// tipInput(oText);

	// document.onclick = fn;

	function fn(ev) {
		ev = ev || event;

		for(var attr in ev) {
			console.log(attr + ' = ' + ev[attr]);
		}
	}	

	var oDiv = document.getElementById('div1');

	document.onmousemove = function(ev) {
		ev = ev || event;
		var scrollLeft = document.documentElement.scrollLeft || 
			document.body.scrollLeft;
		var scrollTop = document.documentElement.scrollTop || 
			document.body.scrollTop;

		oDiv.style.left = ev.clientX + scrollLeft + 'px';
		oDiv.style.top = ev.clientY + scrollTop + 'px';
	};
};

var oForm = null;
var oText = null;

function doFocus(tip) {
	if(this.value == tip) {
		this.value = '';
	}
}

function doBlur(tip) {
	if(this.value === '') {
		this.value = tip;
	}
}

function tipInput(obj) {

	var tip = obj.value;

	obj.onfocus = function() {
		if(this.value == tip) {
			this.value = '';
		}
	};

	obj.onblur = function() {
		if(this.value === '') {
			this.value = tip;
		}
	};

}
